﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;
using ECommerce.DAL;
using Entity;

public partial class admin_shipping_list : SiteAdminBasePage
{
    private Int32 OrderID
    {
        get
        {
            try
            {
                if (!string.IsNullOrEmpty(Request.QueryString["oid"]))
                {
                    return Convert.ToInt32(Request.QueryString["oid"]);
                }
                else
                {
                    return 174; /*-1;*/
                }
            }
            catch
            {
                return -1;
            }
        }
    }
    private CustomCollection<TblProductPurchaseOrder_MultipleShippingInfo> _orders;
    public CustomCollection<TblProductPurchaseOrder_MultipleShippingInfo> Order
    {
        get
        {
            return TblProductPurchaseOrder_MultipleShippingInfo.GetTblProductPurchaseOrder_MultipleShippingInfoByOrderId(OrderID);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Order == null)
            {
                Response.Redirect(AutoGear.BLL.CustomSiteMap.SalesCCSuccess);
            }
            BindOrders();
        }
    }

    //protected void Store1_RefreshData(object sender, StoreRefreshDataEventArgs e)
    //{
    //    BindOrders(e.Sort + (e.Dir.ToString() == "Default" ? "" : " " + e.Dir), e.Start, e.Limit);
    //}

    private void BindOrders()
    {

        CustomCollection<TblProductPurchaseOrder_MultipleShippingInfo> shippings = TblProductPurchaseOrder_MultipleShippingInfo.GetTblProductPurchaseOrder_MultipleShippingInfoByOrderId(OrderID);

        Store1.DataSource = shippings;
        Store1.DataBind();

       // (Store1.Proxy[0] as PageProxy).Total = totalCount;
    }
}